package com.gitee.wsl.android.ui.base

import com.gitee.wsl.common.ui.base.Padding
import com.gitee.wsl.mathematics.geometry.shape.Rectangle

class RectanglePadding(val innerRectangle: Rectangle): Padding() {
    override var left: Float
        get() = super.left
        set(value) {
            val dif = value - super.left
            super.left=value
            innerRectangle.left += dif
        }
    override var top: Float
        get() = super.top
        set(value) {
            val dif = value - super.top
            super.top=value
            innerRectangle.top += dif
        }
    override var right: Float
        get() = super.right
        set(value) {
            val dif = value - super.right
            super.right = value
            innerRectangle.right -= dif
        }
    override var bottom: Float
        get() = super.bottom
        set(value) {
            val dif = value - super.bottom
            super.left=value
            innerRectangle.bottom -= dif
        }
}